/**
 * 网络请求的方法
 */
import axios from "axios";
import base from "./base";

const api = {
  /**
   * 登陆
   */
  login(params) {
    return axios({
      headers: {
        "Content-Type": "application/x-www-form-urlencoded",
      },
      method: "post",
      url: base.baseUrl + base.login,
      data: params,
    });
  },

  /**
   * 注册
   */
  register(params) {
    return axios({
      headers: {
        "Content-Type": "application/x-www-form-urlencoded",
      },
      method: "post",
      url: base.baseUrl + base.register,
      data: params,
    });
  },
};

export default api;
